package com.dandelion.common.dao.auto.mapper;

import com.dandelion.common.dao.auto.pojo.AdminUser;
import com.dandelion.common.dao.auto.pojo.AdminUserCriteria;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface AdminUserMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_admin_user
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @SelectProvider(type=AdminUserSqlProvider.class, method="countByExample")
    long countByExample(AdminUserCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_admin_user
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @DeleteProvider(type=AdminUserSqlProvider.class, method="deleteByExample")
    int deleteByExample(AdminUserCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_admin_user
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @Delete({
        "delete from t_admin_user",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_admin_user
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @Insert({
        "insert into t_admin_user (username, nickname, ",
        "password, status, ",
        "is_locked, is_admin, ",
        "is_deleted, create_time, ",
        "update_time)",
        "values (#{username,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR}, ",
        "#{password,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, ",
        "#{isLocked,jdbcType=TINYINT}, #{isAdmin,jdbcType=TINYINT}, ",
        "#{isDeleted,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(AdminUser record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_admin_user
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @InsertProvider(type=AdminUserSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insertSelective(AdminUser record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_admin_user
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @SelectProvider(type=AdminUserSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="username", property="username", jdbcType=JdbcType.VARCHAR),
        @Result(column="nickname", property="nickname", jdbcType=JdbcType.VARCHAR),
        @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.TINYINT),
        @Result(column="is_locked", property="isLocked", jdbcType=JdbcType.TINYINT),
        @Result(column="is_admin", property="isAdmin", jdbcType=JdbcType.TINYINT),
        @Result(column="is_deleted", property="isDeleted", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<AdminUser> selectByExample(AdminUserCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_admin_user
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @Select({
        "select",
        "id, username, nickname, password, status, is_locked, is_admin, is_deleted, create_time, ",
        "update_time",
        "from t_admin_user",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="username", property="username", jdbcType=JdbcType.VARCHAR),
        @Result(column="nickname", property="nickname", jdbcType=JdbcType.VARCHAR),
        @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.TINYINT),
        @Result(column="is_locked", property="isLocked", jdbcType=JdbcType.TINYINT),
        @Result(column="is_admin", property="isAdmin", jdbcType=JdbcType.TINYINT),
        @Result(column="is_deleted", property="isDeleted", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    AdminUser selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_admin_user
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @UpdateProvider(type=AdminUserSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") AdminUser record, @Param("example") AdminUserCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_admin_user
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @UpdateProvider(type=AdminUserSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") AdminUser record, @Param("example") AdminUserCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_admin_user
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @UpdateProvider(type=AdminUserSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(AdminUser record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_admin_user
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @Update({
        "update t_admin_user",
        "set username = #{username,jdbcType=VARCHAR},",
          "nickname = #{nickname,jdbcType=VARCHAR},",
          "password = #{password,jdbcType=VARCHAR},",
          "status = #{status,jdbcType=TINYINT},",
          "is_locked = #{isLocked,jdbcType=TINYINT},",
          "is_admin = #{isAdmin,jdbcType=TINYINT},",
          "is_deleted = #{isDeleted,jdbcType=TINYINT},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(AdminUser record);
}